package titan.wizards.newPackagedSection;

import org.eclipse.jface.wizard.IWizardPage;
import titan.messages.Messages;
import titan.wizards.BaseTitanWizard;

/**
 *  Wizard to create a new Titan section
 */
public class SectionWizard extends BaseTitanWizard {
	private SectionPage sectionPage;

	public SectionWizard() {
		super();
		setNeedsProgressMonitor(true);
		sectionPage = new SectionPage();
	}

	/**
	 * {@inheritDoc}
	 */
	public void init() throws Exception {
		sectionPage.loadPackages(project);
	}

	/**
	 * {@inheritDoc}
	 */
	public void addPages() {
		addPage(sectionPage);
	}

	/**
	 * {@inheritDoc}
	 */
	public IWizardPage getFirstPage(){
		return sectionPage;
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean performFinish() {
		return sectionPage.createSectionFromSelectedPackage();
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean canFinish() {
		return sectionPage.canFinish();
	}

	/**
	 * {@inheritDoc}
	 */
	public String getWindowTitle() {
		return new String(Messages.NewSection);
	}
}